package com.hoas.quickstart.threads.chapter02.chapter02_2_8_03;

public class Service {


    public void testMethod1(MyObject object) {
        synchronized (object) {
            try {

                System.out.println("testMethod1 __getLock time=" + System.currentTimeMillis()
                    + " run thread-name=" + Thread.currentThread().getName());

                Thread.sleep(5000);

                System.out.println("testMethod1 releaseLock time=" + System.currentTimeMillis()
                        + " run thread-name=" + Thread.currentThread().getName());


            }catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}
